package com.ruoyi.common.enums;

public enum OrderStatus {
    NOT_START("1", "未开始"),
    UNDER_WAY("2", "进行中"),
    COMPLETED("3", "已完成"),
    TO_BE_MODIFIED("4", "待修改");

    private final String code;

    private final String value;

    OrderStatus(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {

        return code;
    }

    public String getValue() {
        return value;
    }

    public static OrderStatus getOrderStatus(String code) {
        for (OrderStatus orderStatus : OrderStatus.values()) {
            if (orderStatus.getCode().equals(code)) {
                return orderStatus;
            }
        }
        return null;
    }
}
